package com.etc.demo0530.mapper;

import com.etc.demo0530.entity.Goods;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface GoodsMapper {
    /**
     * 查询的方法
     * @param goodsid
     * @return
     */
    public Goods selectById(Integer goodsid);

    /**
     * 添加记录
     * @param goods
     * @return
     */
    public Integer addGoods(Goods goods);

    /**
     * 修改商品
     * @param goods
     * @return
     */
    public Integer updateGoods(Goods goods);


    /**
     * 根据id删除记录
     * @param goodsid
     * @return
     */
    public Integer deleteById(Integer goodsid);


    /**
     * 动态sql演示
     * @param goods
     * @return
     */
    public List<Goods> selectDySQL(Goods goods);


    /**
     * 修改商品
     * @param goods
     * @return
     */
    public Integer updateGoodsByDySQL(Goods goods);


    public Page<Goods> selectByLike(String keywords);
}
